Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra decrement of totalIP count #2042

Merged
merged 6 commits into from
Oct 12, 2022
Merged

Conversation

jayanthvn
Copy link
Contributor

@jayanthvn jayanthvn commented Jul 25, 2022

What type of PR is this?
Bug

Which issue does this PR fix:
Wrong computation of totalIPs

What does this PR do / Why do we need it:
The issue is because we decrement the total here -

and decrement again here
ds.total -= deletableCidr.Size()
while we force delete the secondary IP because we are in PD mode and we don't need the IP/32 anymore attached to the instance.

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:
#2041

Testing done on this change:

Repro'ed the issue and fix is holding up

Secondary IP mode and 1 pod running ->

"TotalIPs":10,"AssignedIPs":1

PD mode toggle ->

"TotalIPs":17,"AssignedIPs":1

Deleted the pod behind secondary IP ->

"TotalIPs":16,"AssignedIPs":0

Automation added to e2e:

PASS
coverage: 61.8% of statements
ok  	github.com/aws/amazon-vpc-cni-k8s/pkg/ipamd/datastore	60.043s	coverage: 61.8% of statements

Will this PR introduce any new dependencies?:

No

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No

Does this change require updates to the CNI daemonset config files to work?:

No

Does this PR introduce any user-facing change?:

No


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jayanthvn jayanthvn requested a review from a team as a code owner July 25, 2022 23:14
@jayanthvn jayanthvn requested a review from achevuru July 25, 2022 23:14
@github-actions
Copy link

github-actions bot commented Oct 2, 2022

This pull request is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days

@github-actions github-actions bot added the stale Issue or PR is stale label Oct 2, 2022
@jayanthvn
Copy link
Contributor Author

/not stale

pkg/ipamd/datastore/data_store_test.go Show resolved Hide resolved
pkg/ipamd/datastore/data_store_test.go Show resolved Hide resolved
pkg/ipamd/datastore/data_store_test.go Show resolved Hide resolved
pkg/ipamd/datastore/data_store_test.go Show resolved Hide resolved
pkg/ipamd/datastore/data_store_test.go Show resolved Hide resolved
pkg/ipamd/datastore/data_store_test.go Show resolved Hide resolved
@jayanthvn jayanthvn merged commit e65d256 into aws:master Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants